\hypertarget{group__nxbot__pwm}{
\section{PWM Library}
\label{group__nxbot__pwm}\index{PWM Library@{PWM Library}}
}


PWM library for applying different velocities to the motors in NXBOT.  
\subsection*{Defines}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{group__nxbot__pwm_ga173370575e519e4b39a40dcbed25b05c}{MASK\_\-FREQ}~0xF8
\item 
\#define \hyperlink{group__nxbot__pwm_ga1380779eb88f44d3b04f56f34844cd49}{PRESCALER\_\-1}~1
\item 
\#define \hyperlink{group__nxbot__pwm_gaea484618f5434fb66fe764a38f440f1b}{PRESCALER\_\-8}~2
\item 
\#define \hyperlink{group__nxbot__pwm_ga8ef1c1674bc0e2e5a50b5ef05333acbb}{PRESCALER\_\-64}~3
\item 
\#define \hyperlink{group__nxbot__pwm_ga052c8c73dbda6c25f480ace56519a596}{PRESCALER\_\-256}~4
\item 
\#define \hyperlink{group__nxbot__pwm_gadf7f1e9c11964c6871486a89e6cce487}{PRESCALER\_\-1024}~5
\item 
\#define \hyperlink{group__nxbot__pwm_ga1df990f1a1fc97b95e8d53f719968026}{MAX\_\-PWM}~127
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{group__nxbot__pwm_gaa8b8bbd1655fae8802b479327355a9e2}{configPwm} (unsigned char freq)
\item 
void \hyperlink{group__nxbot__pwm_ga7a0e2901860a615a91f8f41fec8c75e8}{setFreqPwm} (unsigned char freq)
\item 
unsigned char \hyperlink{group__nxbot__pwm_gaf3b92a34490a16a3781ba5f6548dd205}{getFreqPwm} (void)
\item 
void \hyperlink{group__nxbot__pwm_gafbfae8c7ddb23906a8e0863e8ddda681}{setPwmRight} (signed char right)
\item 
void \hyperlink{group__nxbot__pwm_ga5cb285add5e33db68d6e53a7f309ce3b}{setPwmLeft} (signed char left)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
PWM library for applying different velocities to the motors in NXBOT. 
\begin{DoxyCode}
 #include <pwm.h> 
\end{DoxyCode}
 This module uses timer0 of the ATmega1281 microcontroller for generating the desired PWM signals. This library does not need to have the interrupts in order to function correctly. 

\subsection{Define Documentation}
\hypertarget{group__nxbot__pwm_ga173370575e519e4b39a40dcbed25b05c}{
\index{nxbot\_\-pwm@{nxbot\_\-pwm}!MASK\_\-FREQ@{MASK\_\-FREQ}}
\index{MASK\_\-FREQ@{MASK\_\-FREQ}!nxbot_pwm@{nxbot\_\-pwm}}
\subsubsection[{MASK\_\-FREQ}]{\setlength{\rightskip}{0pt plus 5cm}\#define MASK\_\-FREQ~0xF8}}
\label{group__nxbot__pwm_ga173370575e519e4b39a40dcbed25b05c}
\hypertarget{group__nxbot__pwm_ga1df990f1a1fc97b95e8d53f719968026}{
\index{nxbot\_\-pwm@{nxbot\_\-pwm}!MAX\_\-PWM@{MAX\_\-PWM}}
\index{MAX\_\-PWM@{MAX\_\-PWM}!nxbot_pwm@{nxbot\_\-pwm}}
\subsubsection[{MAX\_\-PWM}]{\setlength{\rightskip}{0pt plus 5cm}\#define MAX\_\-PWM~127}}
\label{group__nxbot__pwm_ga1df990f1a1fc97b95e8d53f719968026}
\hypertarget{group__nxbot__pwm_ga1380779eb88f44d3b04f56f34844cd49}{
\index{nxbot\_\-pwm@{nxbot\_\-pwm}!PRESCALER\_\-1@{PRESCALER\_\-1}}
\index{PRESCALER\_\-1@{PRESCALER\_\-1}!nxbot_pwm@{nxbot\_\-pwm}}
\subsubsection[{PRESCALER\_\-1}]{\setlength{\rightskip}{0pt plus 5cm}\#define PRESCALER\_\-1~1}}
\label{group__nxbot__pwm_ga1380779eb88f44d3b04f56f34844cd49}
\hypertarget{group__nxbot__pwm_gadf7f1e9c11964c6871486a89e6cce487}{
\index{nxbot\_\-pwm@{nxbot\_\-pwm}!PRESCALER\_\-1024@{PRESCALER\_\-1024}}
\index{PRESCALER\_\-1024@{PRESCALER\_\-1024}!nxbot_pwm@{nxbot\_\-pwm}}
\subsubsection[{PRESCALER\_\-1024}]{\setlength{\rightskip}{0pt plus 5cm}\#define PRESCALER\_\-1024~5}}
\label{group__nxbot__pwm_gadf7f1e9c11964c6871486a89e6cce487}
\hypertarget{group__nxbot__pwm_ga052c8c73dbda6c25f480ace56519a596}{
\index{nxbot\_\-pwm@{nxbot\_\-pwm}!PRESCALER\_\-256@{PRESCALER\_\-256}}
\index{PRESCALER\_\-256@{PRESCALER\_\-256}!nxbot_pwm@{nxbot\_\-pwm}}
\subsubsection[{PRESCALER\_\-256}]{\setlength{\rightskip}{0pt plus 5cm}\#define PRESCALER\_\-256~4}}
\label{group__nxbot__pwm_ga052c8c73dbda6c25f480ace56519a596}
\hypertarget{group__nxbot__pwm_ga8ef1c1674bc0e2e5a50b5ef05333acbb}{
\index{nxbot\_\-pwm@{nxbot\_\-pwm}!PRESCALER\_\-64@{PRESCALER\_\-64}}
\index{PRESCALER\_\-64@{PRESCALER\_\-64}!nxbot_pwm@{nxbot\_\-pwm}}
\subsubsection[{PRESCALER\_\-64}]{\setlength{\rightskip}{0pt plus 5cm}\#define PRESCALER\_\-64~3}}
\label{group__nxbot__pwm_ga8ef1c1674bc0e2e5a50b5ef05333acbb}
\hypertarget{group__nxbot__pwm_gaea484618f5434fb66fe764a38f440f1b}{
\index{nxbot\_\-pwm@{nxbot\_\-pwm}!PRESCALER\_\-8@{PRESCALER\_\-8}}
\index{PRESCALER\_\-8@{PRESCALER\_\-8}!nxbot_pwm@{nxbot\_\-pwm}}
\subsubsection[{PRESCALER\_\-8}]{\setlength{\rightskip}{0pt plus 5cm}\#define PRESCALER\_\-8~2}}
\label{group__nxbot__pwm_gaea484618f5434fb66fe764a38f440f1b}


\subsection{Function Documentation}
\hypertarget{group__nxbot__pwm_gaa8b8bbd1655fae8802b479327355a9e2}{
\index{nxbot\_\-pwm@{nxbot\_\-pwm}!configPwm@{configPwm}}
\index{configPwm@{configPwm}!nxbot_pwm@{nxbot\_\-pwm}}
\subsubsection[{configPwm}]{\setlength{\rightskip}{0pt plus 5cm}void configPwm (unsigned char {\em freq})}}
\label{group__nxbot__pwm_gaa8b8bbd1655fae8802b479327355a9e2}
\hypertarget{group__nxbot__pwm_gaf3b92a34490a16a3781ba5f6548dd205}{
\index{nxbot\_\-pwm@{nxbot\_\-pwm}!getFreqPwm@{getFreqPwm}}
\index{getFreqPwm@{getFreqPwm}!nxbot_pwm@{nxbot\_\-pwm}}
\subsubsection[{getFreqPwm}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char getFreqPwm (void)}}
\label{group__nxbot__pwm_gaf3b92a34490a16a3781ba5f6548dd205}
\hypertarget{group__nxbot__pwm_ga7a0e2901860a615a91f8f41fec8c75e8}{
\index{nxbot\_\-pwm@{nxbot\_\-pwm}!setFreqPwm@{setFreqPwm}}
\index{setFreqPwm@{setFreqPwm}!nxbot_pwm@{nxbot\_\-pwm}}
\subsubsection[{setFreqPwm}]{\setlength{\rightskip}{0pt plus 5cm}void setFreqPwm (unsigned char {\em freq})}}
\label{group__nxbot__pwm_ga7a0e2901860a615a91f8f41fec8c75e8}
\hypertarget{group__nxbot__pwm_ga5cb285add5e33db68d6e53a7f309ce3b}{
\index{nxbot\_\-pwm@{nxbot\_\-pwm}!setPwmLeft@{setPwmLeft}}
\index{setPwmLeft@{setPwmLeft}!nxbot_pwm@{nxbot\_\-pwm}}
\subsubsection[{setPwmLeft}]{\setlength{\rightskip}{0pt plus 5cm}void setPwmLeft (signed char {\em left})}}
\label{group__nxbot__pwm_ga5cb285add5e33db68d6e53a7f309ce3b}
\hypertarget{group__nxbot__pwm_gafbfae8c7ddb23906a8e0863e8ddda681}{
\index{nxbot\_\-pwm@{nxbot\_\-pwm}!setPwmRight@{setPwmRight}}
\index{setPwmRight@{setPwmRight}!nxbot_pwm@{nxbot\_\-pwm}}
\subsubsection[{setPwmRight}]{\setlength{\rightskip}{0pt plus 5cm}void setPwmRight (signed char {\em right})}}
\label{group__nxbot__pwm_gafbfae8c7ddb23906a8e0863e8ddda681}
